import java.lang.reflect.Method;

/**
 * @author <a href='mailto:maruichao52@gmail.com'>MRC</a>
 * @since 2021/4/21
 */
public class Main {

    public static void main(String[] args) throws Exception {

        MyClassLoader classLoader = new MyClassLoader();

        Class<?> classes = classLoader.loadClass("CustomObjectA");
        Object obj = classes.newInstance();

        Method method = classes.getDeclaredMethod("test", null);
        Object result = method.invoke(obj);

        System.out.println(classes.getClassLoader());
        System.out.println(classLoader.getParent());
    }

}
